package cn.wolfcode.shop.cloud.pay;

import com.alipay.api.AlipayClient;
import com.alipay.api.DefaultAlipayClient;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class AlipayConfiguration {

    @Bean
    public AlipayClient alipayClient(AlipayConfig alipayConfig){
       return new DefaultAlipayClient(alipayConfig.getGatewayUrl(), alipayConfig.getApp_id(), alipayConfig.getMerchant_private_key()
               , "json",alipayConfig.getCharset(), alipayConfig.getAlipay_public_key(), alipayConfig.getSign_type());

    }
}
